﻿using Model.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 一个命令的封装信息
    /// </summary>
    public class Command
    {
        /// <summary>
        /// 命令的名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 命令描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 命令参数
        /// </summary>
        public List<CommandParam> Params { get; set; }
        /// <summary>
        /// 命令视图
        /// </summary>
        public List<string> View { get; set; }
        /// <summary>
        /// 这个命令是否可以作为结束（不包含参数） 可以作为结束，则必须有type和method来执行命令
        /// </summary>
        public bool CanEnd { get; set; }
        /// <summary>
        /// 命令对应执行函数的类的type
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// 命令对应执行函数的函数名称
        /// </summary>
        public string Method { get; set; }
        /// <summary>
        /// 父命令
        /// </summary>
        public List<Command> SubCommand { get; set; }
        /// <summary>
        /// 命令的完整命令
        /// </summary>
        public string FullCommand { get; set; }

        public override string ToString()
        {
            return $"name={Name}, Description={Description}, Params={Params.Count}, View={View}, CanEnd={CanEnd}, Type={Type}, Method={Method}";
        }

    }
}
